<template>
<h1>隐藏显示指令</h1>
<!--  v-if  true表示元素显示, false表示元素隐藏-->
  <p  v-if="isShow"> IF显示</p> &nbsp;
  <p  v-show="isShow"> 显示</p>
  <button @click="nf()">隐藏</button>
  <button @click="f()">显示</button>
</template>


<script setup>
import {ref} from "vue";

const  isShow = ref(true);


const nf = ()=>{
  isShow.value=false;
}
const f = ()=>{
  isShow.value= true;
}
</script>

<style scoped>

</style>